﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLogic;
using BusinessObject;
using System.Web.Security;
namespace WebTeamplate
{
    public partial class Admin_Login : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //Load default page
            //Vw_aspnet_Roles objRole=UserProfileUtil.GetMaxRole(this
          

        }
        protected void Login1_LoggedIn(object sender, EventArgs e)
        {
           // CheckTimeLeft();
            MembershipUser user = Membership.GetUser(Login1.UserName);
            if (user != null)
            {
                Vw_aspnet_RolesResult objRole = UserProfileUtil.GetMaxRole(new Guid(user.ProviderUserKey.ToString()), this.applicationName);
                if (objRole != null)
                    Response.Redirect(objRole.Description);
                else Response.Redirect("Default.aspx");
            }

        }
      
    }
}
